package dk.eal.kbr.mule.component.exchange;

import org.mule.api.MuleEventContext;

public class MoveMessageVariablesToPayload implements org.mule.api.lifecycle.Callable {

	@Override
	public Object onCall(MuleEventContext eventContext) throws Exception {
		ExchangeCalenderItem calenderItem = (ExchangeCalenderItem)eventContext.transformMessage(ExchangeCalenderItem.class);
		String  email = eventContext.getMessage().getInvocationProperty("email");
		String  password = eventContext.getMessage().getInvocationProperty("password");
		calenderItem.setEmail(email);
		calenderItem.setPassword(password);
		return calenderItem;
	}

}
